local zhanggong = fk.CreateSkill {
  name = "lingling__zhanggong",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["lingling__zhanggong"] = "张弓",
  [":lingling__zhanggong"] = "锁定技，你的攻击范围始终+3。",

  --["#lingling__zhanggong-invoke"] = "张弓：你可以视为对一名手牌少于你攻击范围的角色使用【杀】",
}

--[[zhanggong:addEffect(fk.EventPhaseProceeding, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and target.phase == Player.Finish and player:hasSkill(zhanggong.name)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local targets = table.filter(room:getOtherPlayers(player, false), function(to)
      return to:getHandcardNum() < player:getAttackRange()
    end)
    if #targets == 0 then return end
    local ret = room:askToUseVirtualCard(player, {
      name = "slash",
      skill_name = zhanggong.name,
      prompt = "#lingling__zhanggong-invoke",
      extra_data = {
        bypass_distances = true,
        bypass_times = true,
        include_targets = table.map(targets, Util.IdMapper),
        extraUse = true
      },
      skip = true
    })
    if ret then
      event:setCostData(self, ret)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:useCard(event:getCostData(self))
  end,
})]]--

zhanggong:addEffect("atkrange", {
  correct_func = function(self, from, to)
    if from:hasSkill(zhanggong.name) then
      return 3
    end
  end,
})

return zhanggong
